{% extends "bets/base_site.html" %}

{% block center-content %}
<div class="well">
<div id = "teams">

<div style="margin-left: 400px;">
	<h4>Balance: {{ gold }}</h4>
</div>

<div style="height: 20px;">
	{% if error_message %}
		<p style="color: red;"><strong>Error: {{ error_message }}</strong></p>
	{% endif %}
</div>

	<form action="" method="post">{% csrf_token %}
	{% if bet.type == "yes/no" %}
	    <input type="radio" name="yes/no" value="yes" /> yes<br />
	    <input type="radio" name="yes/no" value="no" /> no<br />
	    <br>		
	{% else %}
		{% for team in list %}
			{% if bet.type == "team" %}
			    <h4><input type="radio" name="team" value="{{ team.id }}" > {{ team.name }}</h4><br />
		    {% else %}
		        <h4>{{ team.name }}</h4>
		    {% endif %}
		    <div class="player">
				{% for player in team.player_set.all %}
				     {% if bet.type == "player" %}
				         <input type="radio" name="player" value="{{ player.id }}"> {{ player.name }}<br><br>
				   	 {% else %}
				   	     <p>{{ player.name }}</p>
				   	 {% endif %}
				{% endfor %}
			</div>
		{% endfor %}		
	{% endif %}

    <br>
    <p>Bet on "{{ bet.description }}" </p>
    <input type="text" name="user_bet" wight=100 placeholder="Type count of money"> <br><br>
    <input type="submit" value="Bet!" style="width: 220px" />
</form>
</div>
	     <hr>
	    <p class="muted">
			<span class="pull-right">
			  <i class="icon-chevron-up"></i>
			  <a href="{% url 'bets:bet_view' bet.game.name tour_id %}" title="">Back to bets</a>
			</span>   
		</p>
		<hr>
</div>
{% endblock %}
